package com.zy.composeworld.base

import androidx.fragment.app.Fragment
import com.zy.composeworld.R
import com.zy.composeworld.databinding.ActivityBaseMainBinding
import com.zy.composeworld.ktx.commit


abstract class BaseMainActivity : BaseActivity<ActivityBaseMainBinding>() {

    override fun getViewBinding() = ActivityBaseMainBinding.inflate(layoutInflater)

    override fun ActivityBaseMainBinding.initViewBinding() {
        containerFragment?.let { fragment ->
            supportFragmentManager.commit(true) {
                add(R.id.base_main_container, fragment)
            }
        }
    }

    protected abstract val containerFragment: Fragment?
}